<template>
	<div class="index-view-rd">
		<top-search></top-search>
		<banner :swiperImg="swiperImg" :canClick="true" :swiperHeight="swiperHeight" :hadSlider="true"></banner>
		<!-- <div class="floor" style="margin-top:-15px;">
			<div class="main-banner">
				<img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1534417148993&di=9ad8b676fcd3232160935416f720a5c7&imgtype=0&src=http%3A%2F%2Fimg.mp.itc.cn%2Fupload%2F20160713%2Fbf58f1733b3e483da58b435b4a2675d5.jpg" alt="">
			</div>
		</div> -->
		<div class="floor" style="margin-top:0;">
			<marquee-list :marqueeList="marqueeList"></marquee-list>
		</div>

		<div class="floor">
			<product-list :prodDatas="hotProduct"></product-list>
		</div>
	</div>
</template>

<style lang="scss">
	.swiper-container-horizontal > .swiper-pagination-bullets{
		bottom: 20px;
	}

	.main-banner{
		width:100%;
		height:115px;
		overflow: hidden;
		border-radius: 15px 15px 0 0;
		margin-top: -15px;
		position:relative;
		z-index: 31;

		img{
			width:100%;
			height:100%;
		}
	}

	.floor{
		margin-top:10px;
		background-color:#ffffff;
		overflow: hidden;
	}
</style>

<script>
	import topSearch from "__cp/topSearch"
	import banner from '__cp/banner'
	//import productList from '__cp/index/productList'
	import marqueeList from '__cp/marqueeList'
	//import {getIndexInfo} from "__api"
	export default{
		name:"index-view",
		components:{ banner, topSearch, marqueeList },
		data(){return{
	      	swiperImg:[],
	      	swiperHeight: "180px",
	      	hotProduct: [],
	      	marqueeList:[
	      		{type:"快讯",contents:"啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊"},
	      		{type:"公告",contents:"dddddddddddddddddddddddddddddddddddddddddddddddd "},
	      		{type:"快讯",contents:"顶顶顶顶顶顶顶顶顶顶顶d顶顶顶顶顶顶顶顶顶顶顶d顶顶顶顶顶顶顶顶顶顶顶d"}
	      	]
		}},
		created(){
			this.$nextTick(function () {
			    this.getIndexData();
			})
		},
		methods:{
			getIndexData:function(){
				// getIndexInfo().then( res => {
				// 	res.banner.forEach((v,i)=>{
				// 		this.swiperImg.push({
				// 			imgUrl:v.image.split(',')[0],
				// 			url:"/productDetail/"+v.id
				// 		})
				// 	})
				// 	this.hotProduct = res.productList.map((v)=>{
				// 		let a =  v.price.toString().split('.');
				// 		v.big_price = a[0]
				// 		v.small_price = a[1]

				// 		v.image = v.image.split(',')

				// 		return v;
				// 	})
				// })
			}
		}
	}

</script>